package com.yiwei.controller;

import java.util.Timer;
import java.util.TimerTask;
import java.util.logging.Logger;

public class YWSchedule {
    private Logger log = Logger.getLogger(YWSchedule.class.getName());
//    private DB db = null;
//
//    public YWSchedule(){
//        this.db = DBMaker.fileDB(new File("testdb"))
//                .closeOnJvmShutdown()
//                .make();
//    }

    

    //同步当天的
    public void oneDaySynchronize() {
        Timer timer = new Timer();
        timer.schedule(new TimerTask() {
            public void run() {
                
            	String daysStr = AssistantConfig.properties.getProperty("task.push.days");
            	int days = -3;
            	if(daysStr!=null) {
            		days = Integer.parseInt(daysStr);
            	}
            	log.info("-------开始同步 "+days+" 天检查记录--------start");
            }
        }, 2000, 10000);// 设定指定的时间time,此处为2000毫秒
    }
    
    //同步所有的 1 分钟一次
    public void allRecordSynchronize() {
        Timer timer = new Timer();
        timer.schedule(new TimerTask() {
            public void run() {
                 
            }
        }, 60, 1000);//  
    }
}
